package com.vincent.template;

import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
import com.alicp.jetcache.anno.config.EnableMethodCache;
import com.vincent.template.commons.base.BaseJpaRepositoryFactoryBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;

@EntityScan(basePackages = "com.vincent.template.domain")
@EnableJpaRepositories(basePackages = "com.vincent.template.repository",
        repositoryFactoryBeanClass = BaseJpaRepositoryFactoryBean.class)
@ComponentScan(basePackages = {
        "com.vincent.template.config",
        "com.vincent.template.store",
        "com.vincent.template.service",
        "com.vincent.template.controller"
})
@EnableJpaAuditing
@SpringBootApplication
@EnableGlobalMethodSecurity(prePostEnabled=true)
@EnableMethodCache(basePackages = "com.vincent.template.store")
@EnableCreateCacheAnnotation
public class TemplateApplication {

    public static void main(String[] args) {
        SpringApplication.run(TemplateApplication.class, args);
    }

}
